$(document).ready(function(){
	
	//$(".generalinfo").attr("style") == "border-bottom: 0");
	
	$(".generalinfo").click(function(){
		if ($(this).attr("style") == "border-bottom: 0;") {
			$(this).attr("style","border-bottom:2px solid rgb(255,101,38);");
			$(this).parent().find(".detailinfo").toggle("normal");
		} else {
			$(this).parent().find(".detailinfo").toggle("normal",function(){
				$(this).parent().find(".generalinfo").attr("style","border-bottom: 0;");
			});
		}
	});
});

function decide() {
	var decideDate = $('#decideDate').val();
	var action = "decideDate";
	var gatherId = $('#gatherId').val();
	$.ajax({
		type: "POST",
		url:'decide.php',
		data:{decideDate:decideDate,action:action,gatherId:gatherId},
		success:function(data) {
			window.location.href="myinfo.php"; 
		},
		error:function(){alert('error');}
	});
}

function cancel(){
	var gatherId = $('#gatherId').val();
	var action = "cancel";
	$.ajax({
		type:"POST",
		url:'decide.php',
		data:{action:action,gatherId:gatherId},
		success:function(data){
			window.location.href="myinfo.php";
		},
		error:function(){alert('error');}
	});
}

function getId(decideDate) {
	document.getElementById("decideDate").value = decideDate;
}